//     <one line to give the program's name and a brief idea of what it does.>
//     Copyright (C) 2021  Qiufeng54321
//
//     This program is free software: you can redistribute it and/or modify
//     it under the terms of the GNU General Public License as published by
//     the Free Software Foundation, either version 3 of the License, or
//     (at your option) any later version.
//
//     This program is distributed in the hope that it will be useful,
//     but WITHOUT ANY WARRANTY; without even the implied warranty of
//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//     GNU General Public License for more details.
//
//     You should have received a copy of the GNU General Public License
//     along with this program.  If not, see <https://www.gnu.org/licenses/>.

// automatically generated by the FlatBuffers compiler, do not modify


#ifndef FLATBUFFERS_GENERATED_MAP_WILLIAMCRAFT_MAP_H_
#define FLATBUFFERS_GENERATED_MAP_WILLIAMCRAFT_MAP_H_

#include "flatbuffers/flatbuffers.h"

namespace williamcraft {
namespace map {

    struct Metadata;
    struct MetadataBuilder;
    struct MetadataT;

    struct Note;

    struct Difficulty;
    struct DifficultyBuilder;
    struct DifficultyT;

    struct Map;
    struct MapBuilder;
    struct MapT;

    struct MapGroup;
    struct MapGroupBuilder;
    struct MapGroupT;

    FLATBUFFERS_MANUALLY_ALIGNED_STRUCT(8) Note FLATBUFFERS_FINAL_CLASS {
    private:
        double time_;
        uint8_t key_;
        int8_t padding0__;
        int16_t padding1__;
        int32_t padding2__;
        double length_;

    public:
        Note()
                : time_(0),
                  key_(0),
                  padding0__(0),
                  padding1__(0),
                  padding2__(0),
                  length_(0) {
            (void) padding0__;
            (void) padding1__;
            (void) padding2__;
        }

        Note(double _time, uint8_t _key, double _length)
                : time_(flatbuffers::EndianScalar(_time)),
                  key_(flatbuffers::EndianScalar(_key)),
                  padding0__(0),
                  padding1__(0),
                  padding2__(0),
                  length_(flatbuffers::EndianScalar(_length)) {
            (void) padding0__;
            (void) padding1__;
            (void) padding2__;
        }

        double time() const {
            return flatbuffers::EndianScalar(time_);
        }

        void mutate_time(double _time) {
            flatbuffers::WriteScalar(&time_, _time);
        }

        uint8_t key() const {
            return flatbuffers::EndianScalar(key_);
        }

        void mutate_key(uint8_t _key) {
            flatbuffers::WriteScalar(&key_, _key);
        }

        double length() const {
            return flatbuffers::EndianScalar(length_);
        }

        void mutate_length(double _length) {
            flatbuffers::WriteScalar(&length_, _length);
        }
    };

    FLATBUFFERS_STRUCT_END(Note, 24);

    struct MetadataT : public flatbuffers::NativeTable {
        typedef Metadata TableType;
        std::string author{};
        std::string audio_path{};
        double audio_offset = 0.0;
        std::string composer{};
        std::vector<std::string> tags{};
        double tempo = 60.0;
    };

    struct Metadata FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
        typedef MetadataT NativeTableType;
        typedef MetadataBuilder Builder;
        enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
            VT_AUTHOR = 4,
            VT_AUDIO_PATH = 6,
            VT_AUDIO_OFFSET = 8,
            VT_COMPOSER = 10,
            VT_TAGS = 12,
            VT_TEMPO = 14
        };

        const flatbuffers::String *author() const {
            return GetPointer<const flatbuffers::String *>(VT_AUTHOR);
        }

        flatbuffers::String *mutable_author() {
            return GetPointer<flatbuffers::String *>(VT_AUTHOR);
        }

        const flatbuffers::String *audio_path() const {
            return GetPointer<const flatbuffers::String *>(VT_AUDIO_PATH);
        }

        flatbuffers::String *mutable_audio_path() {
            return GetPointer<flatbuffers::String *>(VT_AUDIO_PATH);
        }

        double audio_offset() const {
            return GetField<double>(VT_AUDIO_OFFSET, 0.0);
        }

        bool mutate_audio_offset(double _audio_offset) {
            return SetField<double>(VT_AUDIO_OFFSET, _audio_offset, 0.0);
        }

        const flatbuffers::String *composer() const {
            return GetPointer<const flatbuffers::String *>(VT_COMPOSER);
        }

        flatbuffers::String *mutable_composer() {
            return GetPointer<flatbuffers::String *>(VT_COMPOSER);
        }

        const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *tags() const {
            return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_TAGS);
        }

        flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *mutable_tags() {
            return GetPointer<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(VT_TAGS);
        }

        double tempo() const {
            return GetField<double>(VT_TEMPO, 60.0);
        }

        bool mutate_tempo(double _tempo) {
            return SetField<double>(VT_TEMPO, _tempo, 60.0);
        }

        bool Verify(flatbuffers::Verifier& verifier) const {
            return VerifyTableStart(verifier) &&
                   VerifyOffset(verifier, VT_AUTHOR) &&
                   verifier.VerifyString(author()) &&
                   VerifyOffset(verifier, VT_AUDIO_PATH) &&
                   verifier.VerifyString(audio_path()) &&
                   VerifyField<double>(verifier, VT_AUDIO_OFFSET) &&
                   VerifyOffset(verifier, VT_COMPOSER) &&
                   verifier.VerifyString(composer()) &&
                   VerifyOffset(verifier, VT_TAGS) &&
                   verifier.VerifyVector(tags()) &&
                   verifier.VerifyVectorOfStrings(tags()) &&
                   VerifyField<double>(verifier, VT_TEMPO) &&
                   verifier.EndTable();
        }

        MetadataT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;

        void UnPackTo(MetadataT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;

        static flatbuffers::Offset<Metadata> Pack(flatbuffers::FlatBufferBuilder& _fbb, const MetadataT *_o,
                                                  const flatbuffers::rehasher_function_t *_rehasher = nullptr);
    };

    struct MetadataBuilder {
        typedef Metadata Table;
        flatbuffers::FlatBufferBuilder& fbb_;
        flatbuffers::uoffset_t start_;

        void add_author(flatbuffers::Offset<flatbuffers::String> author) {
            fbb_.AddOffset(Metadata::VT_AUTHOR, author);
        }

        void add_audio_path(flatbuffers::Offset<flatbuffers::String> audio_path) {
            fbb_.AddOffset(Metadata::VT_AUDIO_PATH, audio_path);
        }

        void add_audio_offset(double audio_offset) {
            fbb_.AddElement<double>(Metadata::VT_AUDIO_OFFSET, audio_offset, 0.0);
        }

        void add_composer(flatbuffers::Offset<flatbuffers::String> composer) {
            fbb_.AddOffset(Metadata::VT_COMPOSER, composer);
        }

        void add_tags(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> tags) {
            fbb_.AddOffset(Metadata::VT_TAGS, tags);
        }

        void add_tempo(double tempo) {
            fbb_.AddElement<double>(Metadata::VT_TEMPO, tempo, 60.0);
        }

        explicit MetadataBuilder(flatbuffers::FlatBufferBuilder& _fbb)
                : fbb_(_fbb) {
            start_ = fbb_.StartTable();
        }

        flatbuffers::Offset<Metadata> Finish() {
            const auto end = fbb_.EndTable(start_);
            auto o = flatbuffers::Offset<Metadata>(end);
            return o;
        }
    };

    inline flatbuffers::Offset<Metadata> CreateMetadata(
            flatbuffers::FlatBufferBuilder& _fbb,
            flatbuffers::Offset<flatbuffers::String> author = 0,
            flatbuffers::Offset<flatbuffers::String> audio_path = 0,
            double audio_offset = 0.0,
            flatbuffers::Offset<flatbuffers::String> composer = 0,
            flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> tags = 0,
            double tempo = 60.0) {
        MetadataBuilder builder_(_fbb);
        builder_.add_tempo(tempo);
        builder_.add_audio_offset(audio_offset);
        builder_.add_tags(tags);
        builder_.add_composer(composer);
        builder_.add_audio_path(audio_path);
        builder_.add_author(author);
        return builder_.Finish();
    }

    inline flatbuffers::Offset<Metadata> CreateMetadataDirect(
            flatbuffers::FlatBufferBuilder& _fbb,
            const char *author = nullptr,
            const char *audio_path = nullptr,
            double audio_offset = 0.0,
            const char *composer = nullptr,
            const std::vector<flatbuffers::Offset<flatbuffers::String>> *tags = nullptr,
            double tempo = 60.0) {
        auto author__ = author ? _fbb.CreateString(author) : 0;
        auto audio_path__ = audio_path ? _fbb.CreateString(audio_path) : 0;
        auto composer__ = composer ? _fbb.CreateString(composer) : 0;
        auto tags__ = tags ? _fbb.CreateVector<flatbuffers::Offset<flatbuffers::String>>(*tags) : 0;
        return williamcraft::map::CreateMetadata(
                _fbb,
                author__,
                audio_path__,
                audio_offset,
                composer__,
                tags__,
                tempo);
    }

    flatbuffers::Offset<Metadata> CreateMetadata(flatbuffers::FlatBufferBuilder& _fbb, const MetadataT *_o,
                                                 const flatbuffers::rehasher_function_t *_rehasher = nullptr);

    struct DifficultyT : public flatbuffers::NativeTable {
        typedef Difficulty TableType;
        std::string name{};
        std::unique_ptr<williamcraft::map::MapT> map{};
    };

    struct Difficulty FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
        typedef DifficultyT NativeTableType;
        typedef DifficultyBuilder Builder;
        enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
            VT_NAME = 4,
            VT_MAP = 6
        };

        const flatbuffers::String *name() const {
            return GetPointer<const flatbuffers::String *>(VT_NAME);
        }

        flatbuffers::String *mutable_name() {
            return GetPointer<flatbuffers::String *>(VT_NAME);
        }

        const williamcraft::map::Map *map() const {
            return GetPointer<const williamcraft::map::Map *>(VT_MAP);
        }

        williamcraft::map::Map *mutable_map() {
            return GetPointer<williamcraft::map::Map *>(VT_MAP);
        }

        bool Verify(flatbuffers::Verifier& verifier) const {
            return VerifyTableStart(verifier) &&
                   VerifyOffset(verifier, VT_NAME) &&
                   verifier.VerifyString(name()) &&
                   VerifyOffset(verifier, VT_MAP) &&
                   verifier.VerifyTable(map()) &&
                   verifier.EndTable();
        }

        DifficultyT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;

        void UnPackTo(DifficultyT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;

        static flatbuffers::Offset<Difficulty> Pack(flatbuffers::FlatBufferBuilder& _fbb, const DifficultyT *_o,
                                                    const flatbuffers::rehasher_function_t *_rehasher = nullptr);
    };

    struct DifficultyBuilder {
        typedef Difficulty Table;
        flatbuffers::FlatBufferBuilder& fbb_;
        flatbuffers::uoffset_t start_;

        void add_name(flatbuffers::Offset<flatbuffers::String> name) {
            fbb_.AddOffset(Difficulty::VT_NAME, name);
        }

        void add_map(flatbuffers::Offset<williamcraft::map::Map> map) {
            fbb_.AddOffset(Difficulty::VT_MAP, map);
        }

        explicit DifficultyBuilder(flatbuffers::FlatBufferBuilder& _fbb)
                : fbb_(_fbb) {
            start_ = fbb_.StartTable();
        }

        flatbuffers::Offset<Difficulty> Finish() {
            const auto end = fbb_.EndTable(start_);
            auto o = flatbuffers::Offset<Difficulty>(end);
            return o;
        }
    };

    inline flatbuffers::Offset<Difficulty> CreateDifficulty(
            flatbuffers::FlatBufferBuilder& _fbb,
            flatbuffers::Offset<flatbuffers::String> name = 0,
            flatbuffers::Offset<williamcraft::map::Map> map = 0) {
        DifficultyBuilder builder_(_fbb);
        builder_.add_map(map);
        builder_.add_name(name);
        return builder_.Finish();
    }

    inline flatbuffers::Offset<Difficulty> CreateDifficultyDirect(
            flatbuffers::FlatBufferBuilder& _fbb,
            const char *name = nullptr,
            flatbuffers::Offset<williamcraft::map::Map> map = 0) {
        auto name__ = name ? _fbb.CreateString(name) : 0;
        return williamcraft::map::CreateDifficulty(
                _fbb,
                name__,
                map);
    }

    flatbuffers::Offset<Difficulty> CreateDifficulty(flatbuffers::FlatBufferBuilder& _fbb, const DifficultyT *_o,
                                                     const flatbuffers::rehasher_function_t *_rehasher = nullptr);

    struct MapT : public flatbuffers::NativeTable {
        typedef Map TableType;
        std::vector<williamcraft::map::Note> notes{};
    };

    struct Map FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
        typedef MapT NativeTableType;
        typedef MapBuilder Builder;
        enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
            VT_NOTES = 4
        };

        const flatbuffers::Vector<const williamcraft::map::Note *> *notes() const {
            return GetPointer<const flatbuffers::Vector<const williamcraft::map::Note *> *>(VT_NOTES);
        }

        flatbuffers::Vector<const williamcraft::map::Note *> *mutable_notes() {
            return GetPointer<flatbuffers::Vector<const williamcraft::map::Note *> *>(VT_NOTES);
        }

        bool Verify(flatbuffers::Verifier& verifier) const {
            return VerifyTableStart(verifier) &&
                   VerifyOffset(verifier, VT_NOTES) &&
                   verifier.VerifyVector(notes()) &&
                   verifier.EndTable();
        }

        MapT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;

        void UnPackTo(MapT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;

        static flatbuffers::Offset<Map> Pack(flatbuffers::FlatBufferBuilder& _fbb, const MapT *_o,
                                             const flatbuffers::rehasher_function_t *_rehasher = nullptr);
    };

    struct MapBuilder {
        typedef Map Table;
        flatbuffers::FlatBufferBuilder& fbb_;
        flatbuffers::uoffset_t start_;

        void add_notes(flatbuffers::Offset<flatbuffers::Vector<const williamcraft::map::Note *>> notes) {
            fbb_.AddOffset(Map::VT_NOTES, notes);
        }

        explicit MapBuilder(flatbuffers::FlatBufferBuilder& _fbb)
                : fbb_(_fbb) {
            start_ = fbb_.StartTable();
        }

        flatbuffers::Offset<Map> Finish() {
            const auto end = fbb_.EndTable(start_);
            auto o = flatbuffers::Offset<Map>(end);
            return o;
        }
    };

    inline flatbuffers::Offset<Map> CreateMap(
            flatbuffers::FlatBufferBuilder& _fbb,
            flatbuffers::Offset<flatbuffers::Vector<const williamcraft::map::Note *>> notes = 0) {
        MapBuilder builder_(_fbb);
        builder_.add_notes(notes);
        return builder_.Finish();
    }

    inline flatbuffers::Offset<Map> CreateMapDirect(
            flatbuffers::FlatBufferBuilder& _fbb,
            const std::vector<williamcraft::map::Note> *notes = nullptr) {
        auto notes__ = notes ? _fbb.CreateVectorOfStructs<williamcraft::map::Note>(*notes) : 0;
        return williamcraft::map::CreateMap(
                _fbb,
                notes__);
    }

    flatbuffers::Offset<Map> CreateMap(flatbuffers::FlatBufferBuilder& _fbb, const MapT *_o,
                                       const flatbuffers::rehasher_function_t *_rehasher = nullptr);

    struct MapGroupT : public flatbuffers::NativeTable {
        typedef MapGroup TableType;
        std::unique_ptr<williamcraft::map::MetadataT> metadata{};
        std::vector<std::unique_ptr<williamcraft::map::DifficultyT>> difficulties{};
    };

    struct MapGroup FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
        typedef MapGroupT NativeTableType;
        typedef MapGroupBuilder Builder;
        enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
            VT_METADATA = 4,
            VT_DIFFICULTIES = 6
        };

        const williamcraft::map::Metadata *metadata() const {
            return GetPointer<const williamcraft::map::Metadata *>(VT_METADATA);
        }

        williamcraft::map::Metadata *mutable_metadata() {
            return GetPointer<williamcraft::map::Metadata *>(VT_METADATA);
        }

        const flatbuffers::Vector<flatbuffers::Offset<williamcraft::map::Difficulty>> *difficulties() const {
            return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<williamcraft::map::Difficulty>> *>(
                    VT_DIFFICULTIES);
        }

        flatbuffers::Vector<flatbuffers::Offset<williamcraft::map::Difficulty>> *mutable_difficulties() {
            return GetPointer<flatbuffers::Vector<flatbuffers::Offset<williamcraft::map::Difficulty>> *>(
                    VT_DIFFICULTIES);
        }

        bool Verify(flatbuffers::Verifier& verifier) const {
            return VerifyTableStart(verifier) &&
                   VerifyOffset(verifier, VT_METADATA) &&
                   verifier.VerifyTable(metadata()) &&
                   VerifyOffset(verifier, VT_DIFFICULTIES) &&
                   verifier.VerifyVector(difficulties()) &&
                   verifier.VerifyVectorOfTables(difficulties()) &&
                   verifier.EndTable();
        }

        MapGroupT *UnPack(const flatbuffers::resolver_function_t *_resolver = nullptr) const;

        void UnPackTo(MapGroupT *_o, const flatbuffers::resolver_function_t *_resolver = nullptr) const;

        static flatbuffers::Offset<MapGroup> Pack(flatbuffers::FlatBufferBuilder& _fbb, const MapGroupT *_o,
                                                  const flatbuffers::rehasher_function_t *_rehasher = nullptr);
    };

    struct MapGroupBuilder {
        typedef MapGroup Table;
        flatbuffers::FlatBufferBuilder& fbb_;
        flatbuffers::uoffset_t start_;

        void add_metadata(flatbuffers::Offset<williamcraft::map::Metadata> metadata) {
            fbb_.AddOffset(MapGroup::VT_METADATA, metadata);
        }

        void add_difficulties(
                flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<williamcraft::map::Difficulty>>> difficulties) {
            fbb_.AddOffset(MapGroup::VT_DIFFICULTIES, difficulties);
        }

        explicit MapGroupBuilder(flatbuffers::FlatBufferBuilder& _fbb)
                : fbb_(_fbb) {
            start_ = fbb_.StartTable();
        }

        flatbuffers::Offset<MapGroup> Finish() {
            const auto end = fbb_.EndTable(start_);
            auto o = flatbuffers::Offset<MapGroup>(end);
            return o;
        }
    };

    inline flatbuffers::Offset<MapGroup> CreateMapGroup(
            flatbuffers::FlatBufferBuilder& _fbb,
            flatbuffers::Offset<williamcraft::map::Metadata> metadata = 0,
            flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<williamcraft::map::Difficulty>>> difficulties = 0) {
        MapGroupBuilder builder_(_fbb);
        builder_.add_difficulties(difficulties);
        builder_.add_metadata(metadata);
        return builder_.Finish();
    }

    inline flatbuffers::Offset<MapGroup> CreateMapGroupDirect(
            flatbuffers::FlatBufferBuilder& _fbb,
            flatbuffers::Offset<williamcraft::map::Metadata> metadata = 0,
            const std::vector<flatbuffers::Offset<williamcraft::map::Difficulty>> *difficulties = nullptr) {
        auto difficulties__ = difficulties ? _fbb.CreateVector<flatbuffers::Offset<williamcraft::map::Difficulty>>(
                *difficulties) : 0;
        return williamcraft::map::CreateMapGroup(
                _fbb,
                metadata,
                difficulties__);
    }

    flatbuffers::Offset<MapGroup> CreateMapGroup(flatbuffers::FlatBufferBuilder& _fbb, const MapGroupT *_o,
                                                 const flatbuffers::rehasher_function_t *_rehasher = nullptr);

    inline MetadataT *Metadata::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
        auto _o = std::unique_ptr<MetadataT>(new MetadataT());
        UnPackTo(_o.get(), _resolver);
        return _o.release();
    }

    inline void Metadata::UnPackTo(MetadataT *_o, const flatbuffers::resolver_function_t *_resolver) const {
        (void) _o;
        (void) _resolver;
        {
            auto _e = author();
            if (_e) _o->author = _e->str();
        }
        {
            auto _e = audio_path();
            if (_e) _o->audio_path = _e->str();
        }
        {
            auto _e = audio_offset();
            _o->audio_offset = _e;
        }
        {
            auto _e = composer();
            if (_e) _o->composer = _e->str();
        }
        {
            auto _e = tags();
            if (_e) {
                _o->tags.resize(_e->size());
                for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->tags[_i] = _e->Get(_i)->str(); }
            }
        }
        {
            auto _e = tempo();
            _o->tempo = _e;
        }
    }

    inline flatbuffers::Offset<Metadata> Metadata::Pack(flatbuffers::FlatBufferBuilder& _fbb, const MetadataT *_o,
                                                        const flatbuffers::rehasher_function_t *_rehasher) {
        return CreateMetadata(_fbb, _o, _rehasher);
    }

    inline flatbuffers::Offset<Metadata> CreateMetadata(flatbuffers::FlatBufferBuilder& _fbb, const MetadataT *_o,
                                                        const flatbuffers::rehasher_function_t *_rehasher) {
        (void) _rehasher;
        (void) _o;
        struct _VectorArgs {
            flatbuffers::FlatBufferBuilder *__fbb;
            const MetadataT *__o;
            const flatbuffers::rehasher_function_t *__rehasher;
        } _va = {&_fbb, _o, _rehasher};
        (void) _va;
        auto _author = _o->author.empty() ? 0 : _fbb.CreateString(_o->author);
        auto _audio_path = _o->audio_path.empty() ? 0 : _fbb.CreateString(_o->audio_path);
        auto _audio_offset = _o->audio_offset;
        auto _composer = _o->composer.empty() ? 0 : _fbb.CreateString(_o->composer);
        auto _tags = _o->tags.size() ? _fbb.CreateVectorOfStrings(_o->tags) : 0;
        auto _tempo = _o->tempo;
        return williamcraft::map::CreateMetadata(
                _fbb,
                _author,
                _audio_path,
                _audio_offset,
                _composer,
                _tags,
                _tempo);
    }

    inline DifficultyT *Difficulty::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
        auto _o = std::unique_ptr<DifficultyT>(new DifficultyT());
        UnPackTo(_o.get(), _resolver);
        return _o.release();
    }

    inline void Difficulty::UnPackTo(DifficultyT *_o, const flatbuffers::resolver_function_t *_resolver) const {
        (void) _o;
        (void) _resolver;
        {
            auto _e = name();
            if (_e) _o->name = _e->str();
        }
        {
            auto _e = map();
            if (_e) _o->map = std::unique_ptr<williamcraft::map::MapT>(_e->UnPack(_resolver));
        }
    }

    inline flatbuffers::Offset<Difficulty> Difficulty::Pack(flatbuffers::FlatBufferBuilder& _fbb, const DifficultyT *_o,
                                                            const flatbuffers::rehasher_function_t *_rehasher) {
        return CreateDifficulty(_fbb, _o, _rehasher);
    }

    inline flatbuffers::Offset<Difficulty> CreateDifficulty(flatbuffers::FlatBufferBuilder& _fbb, const DifficultyT *_o,
                                                            const flatbuffers::rehasher_function_t *_rehasher) {
        (void) _rehasher;
        (void) _o;
        struct _VectorArgs {
            flatbuffers::FlatBufferBuilder *__fbb;
            const DifficultyT *__o;
            const flatbuffers::rehasher_function_t *__rehasher;
        } _va = {&_fbb, _o, _rehasher};
        (void) _va;
        auto _name = _o->name.empty() ? 0 : _fbb.CreateString(_o->name);
        auto _map = _o->map ? CreateMap(_fbb, _o->map.get(), _rehasher) : 0;
        return williamcraft::map::CreateDifficulty(
                _fbb,
                _name,
                _map);
    }

    inline MapT *Map::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
        auto _o = std::unique_ptr<MapT>(new MapT());
        UnPackTo(_o.get(), _resolver);
        return _o.release();
    }

    inline void Map::UnPackTo(MapT *_o, const flatbuffers::resolver_function_t *_resolver) const {
        (void) _o;
        (void) _resolver;
        {
            auto _e = notes();
            if (_e) {
                _o->notes.resize(_e->size());
                for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->notes[_i] = *_e->Get(_i); }
            }
        }
    }

    inline flatbuffers::Offset<Map>
    Map::Pack(flatbuffers::FlatBufferBuilder& _fbb, const MapT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
        return CreateMap(_fbb, _o, _rehasher);
    }

    inline flatbuffers::Offset<Map>
    CreateMap(flatbuffers::FlatBufferBuilder& _fbb, const MapT *_o, const flatbuffers::rehasher_function_t *_rehasher) {
        (void) _rehasher;
        (void) _o;
        struct _VectorArgs {
            flatbuffers::FlatBufferBuilder *__fbb;
            const MapT *__o;
            const flatbuffers::rehasher_function_t *__rehasher;
        } _va = {&_fbb, _o, _rehasher};
        (void) _va;
        auto _notes = _o->notes.size() ? _fbb.CreateVectorOfStructs(_o->notes) : 0;
        return williamcraft::map::CreateMap(
                _fbb,
                _notes);
    }

    inline MapGroupT *MapGroup::UnPack(const flatbuffers::resolver_function_t *_resolver) const {
        auto _o = std::unique_ptr<MapGroupT>(new MapGroupT());
        UnPackTo(_o.get(), _resolver);
        return _o.release();
    }

    inline void MapGroup::UnPackTo(MapGroupT *_o, const flatbuffers::resolver_function_t *_resolver) const {
        (void) _o;
        (void) _resolver;
        {
            auto _e = metadata();
            if (_e) _o->metadata = std::unique_ptr<williamcraft::map::MetadataT>(_e->UnPack(_resolver));
        }
        {
            auto _e = difficulties();
            if (_e) {
                _o->difficulties.resize(_e->size());
                for (flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) {
                    _o->difficulties[_i] = std::unique_ptr<williamcraft::map::DifficultyT>(
                            _e->Get(_i)->UnPack(_resolver));
                }
            }
        }
    }

    inline flatbuffers::Offset<MapGroup> MapGroup::Pack(flatbuffers::FlatBufferBuilder& _fbb, const MapGroupT *_o,
                                                        const flatbuffers::rehasher_function_t *_rehasher) {
        return CreateMapGroup(_fbb, _o, _rehasher);
    }

    inline flatbuffers::Offset<MapGroup> CreateMapGroup(flatbuffers::FlatBufferBuilder& _fbb, const MapGroupT *_o,
                                                        const flatbuffers::rehasher_function_t *_rehasher) {
        (void) _rehasher;
        (void) _o;
        struct _VectorArgs {
            flatbuffers::FlatBufferBuilder *__fbb;
            const MapGroupT *__o;
            const flatbuffers::rehasher_function_t *__rehasher;
        } _va = {&_fbb, _o, _rehasher};
        (void) _va;
        auto _metadata = _o->metadata ? CreateMetadata(_fbb, _o->metadata.get(), _rehasher) : 0;
        auto _difficulties = _o->difficulties.size()
                             ? _fbb.CreateVector<flatbuffers::Offset<williamcraft::map::Difficulty>>(
                        _o->difficulties.size(), [](size_t i, _VectorArgs *__va) {
                            return CreateDifficulty(*__va->__fbb, __va->__o->difficulties[i].get(), __va->__rehasher);
                        }, &_va) : 0;
        return williamcraft::map::CreateMapGroup(
                _fbb,
                _metadata,
                _difficulties);
    }

    inline const williamcraft::map::MapGroup *GetMapGroup(const void *buf) {
        return flatbuffers::GetRoot<williamcraft::map::MapGroup>(buf);
    }

    inline const williamcraft::map::MapGroup *GetSizePrefixedMapGroup(const void *buf) {
        return flatbuffers::GetSizePrefixedRoot<williamcraft::map::MapGroup>(buf);
    }

    inline MapGroup *GetMutableMapGroup(void *buf) {
        return flatbuffers::GetMutableRoot<MapGroup>(buf);
    }

    inline bool VerifyMapGroupBuffer(
            flatbuffers::Verifier& verifier) {
        return verifier.VerifyBuffer<williamcraft::map::MapGroup>(nullptr);
    }

    inline bool VerifySizePrefixedMapGroupBuffer(
            flatbuffers::Verifier& verifier) {
        return verifier.VerifySizePrefixedBuffer<williamcraft::map::MapGroup>(nullptr);
    }

    inline const char *MapGroupExtension() {
        return "map";
    }

    inline void FinishMapGroupBuffer(
            flatbuffers::FlatBufferBuilder& fbb,
            flatbuffers::Offset<williamcraft::map::MapGroup> root) {
        fbb.Finish(root);
    }

    inline void FinishSizePrefixedMapGroupBuffer(
            flatbuffers::FlatBufferBuilder& fbb,
            flatbuffers::Offset<williamcraft::map::MapGroup> root) {
        fbb.FinishSizePrefixed(root);
    }

    inline std::unique_ptr<williamcraft::map::MapGroupT> UnPackMapGroup(
            const void *buf,
            const flatbuffers::resolver_function_t *res = nullptr) {
        return std::unique_ptr<williamcraft::map::MapGroupT>(GetMapGroup(buf)->UnPack(res));
    }

    inline std::unique_ptr<williamcraft::map::MapGroupT> UnPackSizePrefixedMapGroup(
            const void *buf,
            const flatbuffers::resolver_function_t *res = nullptr) {
        return std::unique_ptr<williamcraft::map::MapGroupT>(GetSizePrefixedMapGroup(buf)->UnPack(res));
    }

}  // namespace map
}  // namespace williamcraft

#endif  // FLATBUFFERS_GENERATED_MAP_WILLIAMCRAFT_MAP_H_
